package com.service;
import java.util.List;
import com.model.TShoucang;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import com.mapper.TShoucangMapper;
@Service
public class TShoucangServiceImpl implements TShoucangService
{
        
        @Autowired
	private TShoucangMapper tShoucangMapper;


	public List<TShoucang> queryTShoucangList(TShoucang tShoucang) throws Exception {
		Map<String, Object> map = new HashMap<String, Object>();
		if(tShoucang!=null){
			 map.put("goodsid", tShoucang.getGoodsid());
			 map.put("uid", tShoucang.getUid());
		}
		
		List<TShoucang> getTShoucang = tShoucangMapper.query(map);
		return getTShoucang;
	}

	public int insertTShoucang(TShoucang tShoucang) throws Exception {
		
		return tShoucangMapper.insertTShoucang(tShoucang);
	}

	public int deleteTShoucang(int id) throws Exception {
		return tShoucangMapper.deleteTShoucang(id);
	}

	public int updateTShoucang(TShoucang tShoucang) throws Exception {
		return tShoucangMapper.updateTShoucang(tShoucang);
	}
	
	public TShoucang queryTShoucangById(int id) throws Exception {
		return tShoucangMapper.queryTShoucangById(id);
	}
 
}
